package lax.task.com;

import java.util.*;

public class Tool {
    /**
     * 使用 Map按value进行排序
     *
     * @param oriMap
     * @return
     */
    public static List<TaskData> sortMapByValue(List<TaskData> oriMap) {
        Collections.sort(oriMap, new Comparator<TaskData>() {
            public int compare(TaskData arg0, TaskData arg1) {
                long temp = arg0.getTime() - arg1.getTime();
                if (temp > 0) {
                    return 1;
                } else if (temp < 0) {
                    return -1;
                } else {
                    return 0;
                }
            }
        });
        return oriMap;
    }
}
